<!--
 * @Author: your name
 * @Date: 2020-08-12 13:38:34
 * @LastEditTime: 2020-08-12 14:04:47
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \use-svg\src\components\IconSelect.vue
-->
<template>
  <div>
    <a-select default-value="xingxing" @change="handleChange">
      <a-select-option v-for="item in iconsMap" :key="item" :value="item" >
        <icon-svg :iconClass="item"></icon-svg> {{item}}
      </a-select-option>
    </a-select>
  </div>
</template>


<script>
import icons from "@/views/iconDemo/createIconMap.js";
export default {
  data() {
    return {
        iconsMap: []
    }
  },
  mounted() {
    const iconList = icons.state.iconsMap.map((i) => {
      return i.default.id.split("-")[1];
    });
    this.iconsMap = iconList;
  },
  methods:{
      handleChange(e){
          this.$emit('update:icon',e);
          this.$emit('onchange',e);
      }
  }
};
</script>

<style lang="scss">
</style>